Part Number Hot Search : 
1N5948D ANTX1 6200CB1 854TG TCR5SB50 TS302 MMBD4448 RD110S
Product Description
Full Text Search
 

To Download AN495 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  rev. 0.2 8/10 copyright ? 2010 by silicon laboratories AN495 AN495 cp2112 i nterface s pecification 1. introduction the silicon laboratories cp2112 is a usb device that adheres to th e usb-defined human interface device class specification. hids communica te with a usb host through the use of repo rts. this document is a specification for the reports supported by the cp2112 and describes the configurable parameters. silicon laboratories provides dynamic libraries that adhere to this spec ification for the follo wing operating systems: ? windows ? ? mac ? this document is inte nded for the following: ? users who are using an operating system that is not supported by the dynamic libraries and who need to implement their own interface. ? users who want to integrate the device interface into their application. figure 1. system architecture diagram pc user application (implementing cp2112 interface specification) hid driver (provided by os) usb root hub cp2112 hid usb-to-smbus bridge smbus devices usb
AN495 2 rev. 0.2 1.1. additional documentation ? cp2112 data sheet: http://www.silabs.com/products/interface/hidusbtosmbus ? dynamic libraries that adhere to this cp2112 interface specification are available for the following operating systems: ?? windows 7/vista/xp ?? mac os x ? an496: cp2112 hid usb-to-smbus api specification documents the windows and mac dll. the document and libraries are available at: http://www.silabs.com/products/interface/hidusbtosmbus ? hid device class definition: http://www.usb.org/developers/hidpage/ 1.2. default values for parameters stored in prom and pin settings table 1 lists the default values for the one-time confi gurable parameters stored in the prom of the cp2112. table 2 lists the default values for the gpio, suspend, an d smbus pins. the gpio pins are configured in ram and should be reconfigured each time the device is re set. the suspend and smbus pins are non-configurable. table 1. default prom values parameter default value vid 0x10c4 pid 0xea90 power 0x32 (100 ma) power mode bus powered release number 0x0100 (release version 01.00) manufacturing string silicon laboratories product string cp2112 hid usb-to-smbus bridge serial string 0001 lock byte 0xff * *note: the lock bytes indicate which parameters have already been programmed. see "7.1. get/set lock byte" on page 17 for more details.
AN495 rev. 0.2 3 table 2. default pin settings parameter default config value gpio0_txt open-drain gpio1_rxt open-drain gpio2 open-drain gpio3 open-drain gpio4 open-drain gpio5 open-drain gpio6 open-drain gpio7_clk open-drain sda open-drain scl open-drain suspend push-pull output suspend push-pull output
AN495 4 rev. 0.2 1.3. default sm bus configuration table 3 lists the default settings for the smbus. t hese settings are used at device power-up or reset. table 3. smbus settings parameter default value clock speed 0x0186a0 (100 khz) device address 0x02 auto send read 0x00 (disabled) write timeout 0x00 (disabled) read timeout 0x00 (disabled) scl low timeout 0x00 (disabled) retry time 0x00 (no limit)
AN495 rev. 0.2 5 2. report overview communication with the cp2112 is performed using hid re ports as defined in the hi d device class definition. the class definition is available for download from http://www.usb.org/developers/hidpage/ . 2.1. reports response the cp2112 responds to reports in different ways, depending on whether the report configures a parameter on the device using a set report or requests data from the dev ice using a get report. a list of all supported reports is available in "3. report id list" on page 6. 2.1.1. set reports in response to a set report, the cp2112 will not return any r eport or acknowled gement of a report. to verify that a report has completed successfully, use the corresponding get report to obtain the data. the delay imposed by the hid protocol between r eports guarantees that there will be no race condition between the execution of a set report and get report verifi cation. a set report will always complete before the devic e receives the get report. 2.1.2. get reports if a report requests data from the device and th e report is valid, the device will re turn a report with the requested data. if the report is in valid, the device will stall. 2.2. data format in all of the reports, the first byte of the data portion of the payload is the repo rt id. in the report definitions in this document, the report id is stored in in dex 0 of the payload and is not explicitly listed in the table. all data content in the report starts at index 1. the reports have a maximum length of 64 bytes, indexed from 0 to 63. for any multi- byte values sent in the reports, the valu es are sent most-significant byte first.
AN495 6 rev. 0.2 3. report id list table 4. report ids report id report name page device configuration (feature request) 0x01 reset device 7 0x02 get/set gpio configuration 8 0x03 get gpio 9 0x04 set gpio 9 0x05 get version information 9 0x06 get/set smbus configuration 10 data transfer (interrupt transfer) 0x10 data read request 11 0x11 data write read request 11 0x12 data read force send 12 0x13 data read response 12 0x14 data write 13 0x15 transfer status request 13 0x16 transfer status response 14 0x17 cancel transfer 15 usb customization (feature requests) 0x20 get/set lock byte 17 0x21 get/set usb configuration 18 0x22 get/set manufacturing string 18 0x23 get/set product string 19 0x24 get/set serial string 19
AN495 rev. 0.2 7 4. device configuration reports 4.1. reset device report id: 0x01 direction: feature request out reset device is used to restart the device from the usb host. the device re-enumerates on the usb bus, and all smbus configuration settings are reset to their default values. if any value other than 0x01 is sent with the reset type field of the command, th e command will be ignored. for certain operating system s, such as windows, initiating a device reset and re-enume rating will make the device's handle stale. the user application is responsible for handling this ?surprise disconnect? event. see ?an496: cp2112 hid usb-to-smbus api specification? fo r more information regarding surprise disconnects. name offset size value description reset type 1 1 0x01 reset with re-enumeration
AN495 8 rev. 0.2 4.2. get/set gpio configuration report id: 0x02 direction: feature request in/out get/set gpio configuration is used to configure the eight gpio pins as input/output an d open-drain/push-pull through the direction and push-pull fields. gpio0 corresponds to bit zero (the least significant bit), and gpio7 corresponds to bit seven (the most significant bit). fo r pins that are configured as an input, push-pull mode is ignored. special is used to enable special functionality on gpio 0_txt, gpio1_rxt, and gpio7_clk. by setting a bit in the special byte of this report, the functionality is enabled. table 5 has more information regarding the special functionality. clock divider specifies the clock output frequency on gpio 7_clk when the clock output is enabled. if clock divider is 0, a 48 mhz clock will be output on gpio7_clk. otherwise, equation 1 can be used to determine the clock output. equation 1. gpio clock frequency output name offset size value description direction 1 1 0x00 0 = input 1 = output push-pull 2 1 0x00 0 = open-drain 1 = push-pull special 3 1 0x00 enables special functions of gpio pins. see table 5. clock divider 4 1 0x00 0 = 48 mhz clock output all other values will output a clock signal determined by equation 1 below. table 5. special function summary bit in special byte of get/set gpio configuration gpio pin value description bit 0 gpio7_clk 0 1 gpio pin clock output - push-pull output bit 1 gpio0_txt 0 1 gpio pin tx toggle - push-pull output bit 2 gpio1_rxt 0 1 gpio pin rx toggle - push-pull output bit 3 - bit 7 ? ? not used gpio7_clk clock frequency 48 mhz 2 clockdivider ? ---------------------------------------------- - =
AN495 rev. 0.2 9 4.3. get gpio values report id: 0x03 direction: feature request in if a pin is configured as a gpio input pin, the corresponding latch value bit represents the input value. if a pin is configured as a gpio output pin, the corresponding latch value bit represents the logic level driven on the pin. gpio0_txt corresponds to bit zero (the least significan t bit), and gpio7_clk corresponds to bit seven (the most significant bit). 4.4. set gpio values report id: 0x04 direction: feature request out set gpio values sets the values for gpio pins. the desired value for the pin is configured in latch value . to drive a ?1? on an output pin, the corresponding bit should be set to ?1?. to drive a ?0? on an output pin, the corresponding bit should be set to ?0?. the report sets new values only for output pins th at have a ?1? in the corresponding bit position in latch mask . if the corresponding bit in latch mask is set to ?0?, a new pin value will not be set, even if the pin is configured as an output pin. the report does not affect any pins that are not configured as outputs. 4.5. get version information report id: 0x05 direction: feature request in part number indicates the device part number. the cp2112 returns 0x0c. device version is the version of the device. this value is not programmable over the hid interface. name offset size value description latch value 1 2 * current latch values name offset size value description latch value 1 1 * latch value latch mask 2 1 * pin to se t to new latch value name offset size value description part number 1 1 0x0c device part number device version 2 1 varies
AN495 10 rev. 0.2 4.6. get/set smbus configuration report id: 0x06 direction: feature request in/out the values in bold are the default values. values from the set report are not stored in prom. these parameters must be initialized after every power-on or device reset. clock speed is the frequency of the smbus clock in hertz (h z). it is stored as a big-endian 4-byte unsigned number. for example, to run the smbus at 400 khz, the value, 0x61a80, would need to be written to four clock speed bytes in this report. if a value of ze ro is written, this parameter is ignored. device address is the 7-bit slave address of the cp2112. the cp2112 will ack th is address, but the cp2112 will not respond to any read or write requests. if the least signific ant bit is set in this byte (r ead/write bit), this parameter is ignored. write timeout and read timeout are the time limits in milliseconds befo re the cp2112 automatically cancels a transfer that has been initiated. if a transfer is canceled by a write or read timeou t, the status byte of the transfer status response command is set appropriately. if this value is set to 0x0000, the device continues to attempt the transfer until the transfer completes or until the cancel transfer command is sent. any value greater than 1000 is ignored. scl low timeout is a timeout that resets the smbus if the scl line is held low for more than 25 ms. if enabled and an scl low timeout occurs, the status byte of the transfer status response command will be set appropriately. any value other than 0x00 and 0x01 is ignored. retry time is the number of attempts that the cp2112 attemp ts to complete a transfer before terminating the transfer. any value greater than 1000 is ignored. name offset size value description clock speed 1 4 0x186a0 * 100 khz smbus clock speed in hertz device address 5 1 0x02 bits 7?1 make up device address (least significant bit is masked) auto send read 6 1 0x00 0x01 disabled enabled write timeout 7 2 0x0000 * no timeout 0?1000 ms timeout value read timeout 9 2 0x0000 * no timeout 0?1000 ms timeout value scl low timeout 11 1 0x00 0x01 disabled enabled retry time 12 2 0x0000 * no limit 0?1000 retries
AN495 rev. 0.2 11 5. data transfer reports 5.1. data read request report id: 0x10 direction: interrupt out slave address is the 7-bit address of the slave device from which data is being read. the address must be between 0xf7 and 0x02 (the least significant bit is the read/write bit and must be zero). all other values are ignored. length is the number of bytes being requested from the slave device. the cp2112 can request between 1 and 512 bytes from a slave device. any value outside that range is ignored. 5.2. data write read request report id: 0x11 direction: interrupt out slave address is the 7-bit address of the slave device from which data is being read. the address must be between 0xf7 and 0x02 (the least significant bit is the read/write bit and must be zero). all other values are ignored. length is the number of bytes that are being requested fr om the slave device. the cp2112 can request between 1 and 512 bytes from a slave device. any value outside that range is ignored. target address length is the number of bytes in the target address of the slave device from which data is being read. the target address length must be between 1 and 16. any value outside that range is ignored. target address is the address of the memory location being read on the slave device. the number of bytes in the target address must match the number of bytes in targ et address length. target address length specifies the number of valid address bytes in target addr ess starting with the byte at offset position 5. this type of report is used when a repeated start condition is used, wh ich is common when accessing an eeprom or something similar. name offset size value description slave address 1 1 * must be between 0x f7 - 0x02. least significant bit is read/write bit and must be zero. length 2 2 * number of bytes (1-512 bytes) to read back name offset size value description slave address 1 1 * must be between 0xf7 and 0x02. least significant bit is the read/write bit and must be zero. length 2 2 * number of bytes (1?512 bytes) to read back target address length 4 1 * number of bytes in target address (from 0x01 to 0x10) target address 5 16 * address of device to be read. the number of bytes in this field must match the number of bytes speci- fied in the target length address above.
AN495 12 rev. 0.2 5.3. data read force send report id: 0x12 direction: interrupt out this forces the device to send a data read response report when the next interrupt in token arrives. this is essentially polled mode reading. the pc should poll using transfer status request first to determine whether data is ready. the number of bytes requested can be 1 to 512. if the number of bytes requested is greater than the number of valid bytes in the cp2112?s received by tes buffer, only the valid bytes will be returned. this command should only be used when auto send read is set to 0x00. this command is ignored when auto send read is set to 0x01. if a transfer is not in progress or if no data is in the buffer, this command performs no action. this command can be used while a read is in progress to retrieve the data received so far. 5.4. data read response report id: 0x13 direction: interrupt in data for data read request, data write request, and data read force send will be returned to the host with this report id. status shows the current status of the smbus transmission. length is the number of valid data bytes being returned to the host. data is the actual data being returned to the host. only the number of bytes specified in the length field will be valid. name offset size value description length 1 2 * number of valid data bytes name offset size value description status 1 1 0x00 0x01 0x02 0x03 idle busy complete (once read, reverts to 0x00) complete with error (once read, reverts to 0x00) length 2 1 * number of valid data bytes data 3 61 * data being returned from the smbus slave device
AN495 rev. 0.2 13 5.5. data write report id: 0x14 direction: interrupt out slave address is the 7-bit address of the slave device to whic h data is being sent. the address must be between 0xf7 and 0x02 (the least significant bit is the read/w rite bit and must be 0). all other values are ignored. length is the number of bytes that are being sent to the slave device. the host can transmit 1 to 61 bytes to the cp2112. any value outside that range is ignored. data is the actual data being sent over the smbus to the slave device. the number of data bytes being sent in this field should match the number of bytes specified in the length field. 5.6. transfer status request report id: 0x15 direction: interrupt out request is used to request the current smbus transfer status. if any value other than 0x01 is sent with the transfer status request, the command will be ignored. name offset size value description slave address 1 1 * must be between 0xf7 - 0x02. least significant bit is read/write bit and must be zero. length 2 1 * number of valid data bytes data 3 61 * data being returned from the smbus slave device name offset size value description request 1 1 0x01 request smbus transfer status
AN495 14 rev. 0.2 5.7. transfer status response report id: 0x16 direction: interrupt in transfer status response returns information on the smbus interface. status 0 returns the general status of the cp2112 smbus interface. if status 0 is 0x00, the rest of the status bytes are not valid. status 1 returns specific information based off of status 0 and is dependent on the value of status 0 . status 2 returns the number of retries before completing, being cancelled, or timing out. status 3 returns the bytes successfully read. for example, if this report returned the following data (in hexadecimal): 16 02 05 00 05 this corresponds to: 16: report id (transfer status response) 02: transmission comp lete without errors 05: succeeded after the following bytes retry 00: indicates zero retries 05: five bytes were received name offset size value description status 0 1 1 0x00 0x01 0x02 0x03 idle busy complete (once read, reverts to 0x00) complete with error (once read, reverts to 0x00) status 1 2 1 * specific conditions based on status 0 (see below) status 2 3 2 * number of retries before completing, being canceled, or timing out status 3 5 2 * number of received bytes status 0 status 1 description 0x01 0x00 0x01 0x02 0x03 address acked address nacked data read in progress data write in progress 0x02 and 0x03 0x00 0x01 0x02 0x03 0x04 0x05 timeout address nacked timeout bus not free (scl low timeout) arbitration lost read incomplete write incomplete succeeded after status 2 retries
AN495 rev. 0.2 15 5.8. cancel transfer report id: 0x17 direction: interrupt out cancel is used to cancel the current smbus transfer. if any value other than 0x01 is sent with the reset command, the command is ignored. name offset size value description cancel 1 1 0x01 will cancel the current transfer. all other values are ignored
AN495 16 rev. 0.2 6. programmable usb parameters the following parameters are programmable on the device. five different reports are provided to program these parameters. each parameter modi fied with these five reports can only be modified once. vid is the usb vendor id. pid is the usb product id. power is the current requested by the devi ce from the usb host in bus-powered mode. the units for this value are milliamps / 2. for example, if the device is configured to request 200 ma, the value for power is 100. the maximum setting for power is 500 ma, or a value of 250. unpowered u sb hubs are limited to providing 100 ma per port. power mode indicates whether the device is operating in bus-powered (0x00), self-powered (0x01, voltage regulator disabled) or self-powered (0x02, voltage regulato r enabled) mode. if the device is configured for self- powered mode, the value programmed for power is not used during usb enumeration. release version is a user-programmable value. the most signific ant byte is the major revision number. the least significant byte in the report is the minor revision number. both bytes can be programmed to any value from 0 to 255. manufacturing string is a 62-byte string in which the first two byte s must be set according to the usb specification (length, 0x03). product string is a 62-byte string in which t he first two bytes must be set according to the usb specification (length, 0x03). serial string is a 62-byte character array used to provide a uniqu e serial number/string for the device. the first two characters must be set according to the usb specification (length, 0x03). name description vid usb vendor id pid usb product id power power request in ma/2 power mode bus powered (0x00) self powered - regulator off (0x01) self powered - regulator on (0x02) release version major and minor release version manufacturer string product manufacturer product string product description serial string serialization string lock byte indicates programmed values
AN495 rev. 0.2 17 7. prom programming reports 7.1. get/set lock byte report id: 0x20 direction: feature request in/out the device has a 1-byte field that indicates which of th e customizable fields have been programmed. the following table shows the values of the bits: if the bit value is set to 1, the corresponding field has not been customized. if the bit val ue is set to 0, the field has been customized or locked and can no longer be changed for this device. using the set lock byte report, any bit value set to 0 will lock the corresponding fi eld. send 0x00 to lock all parameters and prevent future customization. name offset size value description lock status 1 1 see below shows which fields have already been pro- grammed. bit position customizable field bit 0 vid bit 1 pid bit 2 max power bit 3 power mode bit 4 release version bit 5 manufacturer string bit 6 product string bit 7 serial string
AN495 18 rev. 0.2 7.2. get/set us b configuration report id: 0x21 direction: feature request in/out get usb configuration returns the values for the various fields and also the mask value. the mask value is equal to the most significant byte value returned in report get lock byte . if the corresponding mask bit is set to ?0?, the corresponding field has been programmed, and any set usb configuration function operating on that field is ignored. set usb configuration is used to customize thes e fields. the corresponding mask bit should be set to ?1? to program the field. if the field has already been programmed once, an attempt to reprogram it is ignored. if a field is being programmed with the cu rrent value, the progra mmed bit will still be set. see "7.1. get/set lock byte" on page 17 for the definition of mask . if a parameter is being modified using this report, the corresponding bit in mask must be set to a 1. for example, if the vid needed to be programmed, bit 0 of mask would need to be set to a 1, and the values in vid low byte and vid high byte would be written to the cp2112. 7.3. get/set manufacturing string report id: 0x22 direction: feature request in/out the set manufacturing string report can only be used once to set the manufacturing string. any subsequent calls to set manufacturing string are ignored. the maximum value for string length is 60. the first two bytes are allocated for string length and the value 0x03, meaning the actual length of the pstring is 62 bytes. the device will ignore the report if string length is too long. name offset size value description vid low byte 1 1 * vid low byte vid high byte 2 1 * vid high byte pid low byte 3 1 * pid low byte pid high byte 4 1 * pid high byte power 5 1 * power requested in ma/2 power mode 6 1 0x00 0x01 0x02 bus powered self powered - regulator off self powered - regulator on release major 7 1 * release version major value release minor 8 1 * release version minor value mask 9 1 * mask for what fields to program name offset size value description string length 1 1 * length of manufacturer string + 2 usb required 2 1 0x03 required value manufacturing string 3 60 * first 60 bytes of string
AN495 rev. 0.2 19 7.4. get/set product string report id: 0x23 direction: feature request in/out the set product string report can only be used once to set the product string. any subsequent calls to set product string are ignored. the maximum value for string length is 60. the first two bytes are allocated for string length and the value 0x03, meaning the actual length of the payl oad part of the string is 62 byte s. the device will igno re the report if string length is too long. 7.5. get/set serial string report id: 0x24 direction: feature request in/out the set serial string report can only be used once to set the product string. any subsequent calls to set serial string are ignored. the maximum value for string length is 60. the first two bytes are allocated for string length and the value 0x03, meaning the actual leng th of the payload part of the string is 62 bytes. the device will reject the report if string length is too long. name offset size value description string length 1 1 * length of product string + 2 usb required 2 1 0x03 required value product string 3 60 * first 60 bytes of string name offset size value description string length 1 1 * length of serial string + 2 usb required 2 1 0x03 ser string 3 60 * 60 bytes of string
AN495 20 rev. 0.2 a ppendix ?p in c onfiguration o ptions some of the pins of the cp2112 are conf igurable as inputs, open-drain outputs, or push-pull outputs. these options are configured when the device has enumerated and is op erating in a normal mode. when the cp2112 is in usb suspend, all of the configurable pins are limited to be open-drain or push-pull outputs. the following describes the differences between open-drain and push-pull, and the difference in behavior in suspend mode. see the cp2112 data sheet for the electrical specifications of the gpio pins. ? gpio input when a pin is configured as a gpio i nput, the pin can read a logic high or logic low value. internally, the gpio pin is connected to the vio pin through a resistor. if the pin is not connected externally, it will return a logic high or 1. any voltages connected to the pin sh ould conform to data sheet specifications. ? open-drain output when a pin is configured as a gpio open-drain output, th e pin can output a logic high or logic low value. the default value is logic high, and a logic high value is crea ted by internally connecting the gpio pin to the vio pin through a resistor. in this mode, the pin is unable to s ource any current when driving a logic high. if the set gpio values report is used to change the output to a logic low, the pin is in ternally connected to gnd. ? push-pull output when a pin is configured as a gpio push-pull output, th e pin can output a logic high or logic low value. when driving a logic high value, the pin is directly connected to the vio pin in ternally and can source current for devices, such as leds. when driving a logic low value, the pin is internally connected to gnd. ? suspend mode when the device is in suspend mode, all of the gpio pi ns are forced to be open-drain or push-pull outputs. the gpio pins retain their state during suspend mode.
AN495 rev. 0.2 21 d ocument c hange l ist revision 0.1 to revision 0.2 ? updated "4.2. get/s et gpio configuration" on page 8 with special functions. ? changed names of gpio0 to gpio0_txt, gpio1 to gpio1_rxt, and gpio7 to gpio7_clk.
AN495 22 rev. 0.2 c ontact i nformation silicon laboratories inc. 400 west cesar chavez austin, tx 78701 tel: 1+(512) 416-8500 fax: 1+(512) 416-9669 toll free: 1+(877) 444-3032 please visit the silicon labs technical support web page: https://www.silabs.com/support/pages/contacttechnicalsupport.aspx and register to submit a technical support request. silicon laboratories and silicon labs are trademarks of silicon laboratories inc. other products or brandnames mentioned herein are trademarks or registered trademarks of their respective holders. the information in this document is believed to be accurate in all respects at the time of publ ication but is subject to change without notice. silicon laboratories assumes no responsibility for errors and om issions, and disclaims responsibi lity for any consequences resu lting from the use of information included herein. ad ditionally, silicon laboratorie s assumes no responsibility for the functioning of und escribed features or parameters. silicon laboratories reserves the right to make changes without further notice . silicon laboratories makes no wa rranty, rep- resentation or guarantee regarding the suitability of its products for any particular purpose, nor does silicon laboratories as sume any liability arising out of the application or use of any product or circuit, and s pecifically disclaims any and all liability, including wi thout limitation conse- quential or incidental damages. silicon laborat ories products are not designed, intended, or authorized for use in applications intended to support or sustain life, or for any other application in which the failure of t he silicon laboratories product could create a s ituation where per- sonal injury or death may occur. should buyer purchase or us e silicon laboratories products for any such unintended or unauthor ized ap- plication, buyer shall indemnify and hold silicon laboratories harmles s against all claims and damages.


▲Up To Search▲   

 
Price & Availability of AN495

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X